package com.xcode.unit.model;

import com.github.javaparser.ast.Modifier;
import com.github.javaparser.ast.type.Type;

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.Queue;

/**
 * @author liuziying
 * @Description 方法模型
 * @Date 2020/12/25
 */
public class MethodModel implements Serializable {

    private String methodName;
    private Type returnType;
    private Class<?> returnClassType;
    /**
     * LinkedHashMap 保证参数插入有序性
     */
    private Map<String, ParameterModel> parameters;
    private List<String> exceptionTypes;
    private List<String> modifiers;
    /**
     * 输出单元测试方法体
     * Mock
     * assert
     * verify
     */
    private Queue<String> bodyQueue;

    public boolean exist(String parameterName){
        return parameters.containsKey(parameterName);
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public Type getReturnType() {
        return returnType;
    }

    public void setReturnType(Type returnType) {
        this.returnType = returnType;
    }

    public Class<?> getReturnClassType() {
        return returnClassType;
    }

    public void setReturnClassType(Class<?> returnClassType) {
        this.returnClassType = returnClassType;
    }

    public Map<String, ParameterModel> getParameters() {
        return parameters;
    }

    public void setParameters(Map<String, ParameterModel> parameters) {
        this.parameters = parameters;
    }

    public List<String> getExceptionTypes() {
        return exceptionTypes;
    }

    public void setExceptionTypes(List<String> exceptionTypes) {
        this.exceptionTypes = exceptionTypes;
    }

    public Queue<String> getBodyQueue() {
        return bodyQueue;
    }

    public void setBodyQueue(Queue<String> bodyQueue) {
        this.bodyQueue = bodyQueue;
    }

    public List<String> getModifiers() {
        return modifiers;
    }

    public void setModifiers(List<String> modifiers) {
        this.modifiers = modifiers;
    }
}
